package com.yk.fs.controller;

import com.yk.fs.service.hadoop.api.IHadoopService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by Limit on 2017/9/8.
 */
@Controller
@RequestMapping("/hadoop")
public class HadoopController {


    @Resource(name = "hadoopService")
    private IHadoopService hadoopService;

    @RequestMapping("getHadoopCatalog")
    @ResponseBody
    public Object getHadoopCatalog(@RequestParam(name = "id") String current){
        return this.hadoopService.queryChildren(current);
    }
    @RequestMapping("createHadoopFolder")
    @ResponseBody
    public Object createHadoopFolder(@RequestParam(name = "id")String current,@RequestParam(name = "parent")String parent){

        return this.hadoopService.createNode(current,parent);
    }
    @RequestMapping("deleteHadoopFolder")
    @ResponseBody
    public Object deleteHadoopFolder(@RequestParam(name = "id")String current ,@RequestParam(name = "parent")String parent){

        return this.hadoopService.deleteNode(current,parent);
    }

}
